home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / DTS Sample Code / System 7.0 Samples / Kibitz⁄THINK C / Kibitz.protos < prev    next >
Encoding:
Text File  |  1991-02-21  |  6.5 KB  |  211 lines  |  [TEXT/MPS ]

  1. #ifndef __MENUS__
  2. #include <Menus.h>
  3. #endif
  4.  
  5. #ifndef __STANDARDFILE__
  6. #include <StandardFile.h>
  7. #endif
  8.  
  9. /************** AEchess.c **************/
  10.  
  11. void            InitCustomAppleEvents(void);
  12. pascal OSErr    DoAEAnswer(AppleEvent *message, AppleEvent *reply, long refcon);
  13. OSErr            SendGame(FileRecHndl frHndl, short sendReason);
  14. pascal OSErr    ReceiveGameReply(AppleEvent *message, AppleEvent *reply);
  15. pascal OSErr    ReceiveGame(AppleEvent *message, AppleEvent *reply, long refcon);
  16. Boolean            SendMssg(FileRecHndl frHndl, short messageType);
  17. pascal OSErr    ReceiveMssg(AppleEvent *message, AppleEvent *reply, long refcon);
  18. WindowPtr        GetGameWindow(long gameID_0, long gameID_1);
  19. pascal Boolean    KibitzPortFilter(LocationNamePtr locationName, PortInfoPtr thePortInfo);
  20. pascal Boolean    MyIdleProc(EventRecord *event, long *sleep, RgnHandle *mouseRgn);
  21. void            NotifyCancel(void);
  22. void            NotifyUser(void);
  23. void            SetOpponentType(FileRecHndl frHndl, short newOpponentType);
  24.  
  25.  
  26.  
  27. /************** AppleEvents.c **************/
  28.  
  29. void            DoHighLevelEvent(EventRecord *event);
  30. OSErr            GetTargetInfo(AEAddressDesc targetDesc, StringPtr zone, StringPtr machine, StringPtr application);
  31. void            InitAppleEvents(void);
  32. OSErr            MakeTarget(AEAddressDesc *target, Boolean sendDirect, short replyMode, Str255 prompt, Str255 applListLabel,PPCFilterProcPtr portFilter);
  33. Boolean            MissedAnyParameters(AppleEvent *message);
  34. pascal OSErr    DoAEOpenApplication(AppleEvent *message, AppleEvent *reply, long refcon);
  35. pascal OSErr    DoAEOpenDocuments(AppleEvent *message, AppleEvent *reply, long refcon);
  36. pascal OSErr    DoAEPrintDocuments(AppleEvent *message, AppleEvent *reply, long refcon);
  37. pascal OSErr    DoAEQuitApplication(AppleEvent *message, AppleEvent *reply, long refcon);
  38. OSErr            OpenDocEventHandler(AppleEvent *message, AppleEvent *reply, short mode);
  39.  
  40.  
  41.  
  42. /************** BoardSlider.c **************/
  43.  
  44. void            AdjustGameSlider(FileRecHndl frHndl);
  45. ControlHandle    BoardSliderNew(WindowPtr window);
  46. Boolean            RepositionBoard(FileRecHndl frHndl, short newPos, Boolean update);
  47.  
  48.  
  49.  
  50. /************** Chess.c **************/
  51.  
  52. void            AddLegalMove(FileRecHndl game, short from, short to);
  53. Boolean            CastleOkay(FileRecHndl game, short castleSide);
  54. void            EndTheGame(FileRecHndl frHndl, short endReason);
  55. short            GameStatus(FileRecHndl game);
  56. void            GenerateLegalMoves(FileRecHndl game);
  57. void            MakeMove(FileRecHndl game, short moveFrom,short moveTo,
  58.                          short promoteTo, Boolean modifyGame);
  59. void            NewGame(FileRecHndl game);
  60. short            SquareAttacked(FileRecHndl game, short square, short color);
  61. void            UnmakeMove(FileRecHndl game);
  62. short            UpdateTime(FileRecHndl game, Boolean canLose);
  63. short            WhosMove(FileRecHndl game);
  64.  
  65. Boolean            ComputerMove(FileRecHndl game);
  66. void            UpdateGameStatus(FileRecHndl game);
  67. void            DrawButtonTitle(FileRecHndl game, short newVal);
  68. short            CheckForMate(FileRecHndl game, short nodeDepth, short maxDepth);
  69. long            OneDeepEval(FileRecHndl game, short from, short to, short color);
  70. short            BestMove(FileRecHndl game, short nodeDepth, short maxDepth);
  71.  
  72.  
  73.  
  74. /************** Config.c **************/
  75.  
  76. void            DoConfigureGame(FileRecHndl frHndl);
  77. pascal Boolean    configFilter(DialogPtr dlg, EventRecord *event, short *item);
  78.  
  79.  
  80.  
  81. /************** DoCursor.c **************/
  82.  
  83. void            DoCursor(Boolean isAppleEvent, long classID);
  84. void            DoSetCursor(Cursor *cursor);
  85. Rect            BoardRect(void);
  86. Rect            GlobalBoardRect(WindowPtr window);
  87.  
  88.  
  89.  
  90. /************** DoEvent.c **************/
  91.  
  92. short            AlertIfGameOver(FileRecHndl frHndl);
  93. void            DoActivate(WindowPtr window, Boolean becomingActive);
  94. void            DoContentClick(WindowPtr window, EventRecord *event);
  95. void            DoEvent(EventRecord *event);
  96. void            DoUpdate(WindowPtr window);
  97.  
  98.  
  99.  
  100. /************** EventLoop.c **************/
  101.  
  102. void            EventLoop(void);
  103.  
  104.  
  105.  
  106. /************** File.c **************/
  107.  
  108. OSErr            AppDisposeDocument(FileRecHndl frHndl);
  109. Boolean            AppDocumentDirty(FileRecHndl frHndl);
  110. OSErr            AppNewDocument(FileRecHndl *returnHndl);
  111. OSErr            AppOpenDocument(FileRecHndl *result, FSSpecPtr fileToOpen, char permission);
  112. OSErr            AppSaveDocument(FileRecHndl    frHndl, WindowPtr window, short saveMode);
  113. void            ConvertOldToNewSFReply(SFReply *oldReply, StandardFileReply *newReply);
  114. OSErr            Create_OpenFile(FSSpec *file, short *refNum);
  115. Boolean         DisplayGetFile(StandardFileReply *reply);
  116. Boolean         DisplayPutFile(StandardFileReply *reply);
  117. void            IncNewFileNum(Boolean flag);
  118.  
  119. OSErr            AppReadDocument(FileRecHndl frHndl);
  120. OSErr            AppWriteDocument(FileRecHndl frHndl);
  121. OSErr            AppDuplicateDocument(FileRecHndl oldFrHndl, FileRecHndl *newFrHndl);
  122.  
  123.  
  124.  
  125. /************** Help.c **************/
  126.  
  127. void            DynamicBalloonHelp(void);
  128.  
  129.  
  130.  
  131. /************** IdleTasks.c **************/
  132.  
  133. void            DoIdleTasks(Boolean allowComputerMoves);
  134.  
  135.  
  136.  
  137. /************** Init.c **************/
  138.  
  139. void            Initialize(void);
  140. void            StartDocuments(void);
  141.  
  142.  
  143. /************** KibitzWindow.c **************/
  144.  
  145. Boolean            Algebraic(FileRecHndl frHndl, short printMoveNum, short gameIndex, StringPtr pstr);
  146. OSErr            AppNewWindowControls(FileRecHndl frHndl, WindowPtr window);
  147. void            DrawTime(FileRecHndl frHndl);
  148. void            ImageBoardLines(short hOffset, short vOffset);
  149. void            ImageDocument(FileRecHndl frHndl, Boolean justBoard);
  150. void            ImageMoveList(FileRecHndl frHndl, Rect theInk, short hOffset);
  151.  
  152.  
  153. /************** Menu.c **************/
  154.  
  155. void            AdjustMenus(void);
  156. void            DoMenuCommand(long menuResult);
  157. void            EnableOrDisableItem(MenuHandle menu, short item, Boolean enable);
  158.  
  159.  
  160.  
  161. /************** Print.c **************/
  162.  
  163. OSErr            AppPrintDocument(FileRecHndl frHndl, Boolean jobDlg, Boolean firstJob);
  164. OSErr            PresentStyleDialog(FileRecHndl frHndl);
  165.  
  166.  
  167.  
  168. /************** Setup.c **************/
  169.  
  170. void            DoArrangeBoard(FileRecHndl frHndl, Point clickLoc);
  171. void            DrawPalette(FileRecHndl frHndl);
  172. Rect            PaletteRect(void);
  173.  
  174.  
  175.  
  176. /************** Sound.c **************/
  177.  
  178. OSErr            RecordSound(FileRecHndl frHndl);
  179. Boolean            SoundInputAvaliable(void);
  180.  
  181.  
  182.  
  183. /************** Start.c **************/
  184.  
  185. void            main(void);
  186.  
  187.  
  188.  
  189. /************** Utils.c **************/
  190.  
  191. void            appendi2cstr(char *cstr, short i);
  192. short            appendi2pstr(char *pstr, short i);
  193. short            i2cstr(char *cstr, short i);
  194. void            i2pstr(char *pstr, short i);
  195. pascal Boolean    keyEquivFilter(DialogPtr dlg, EventRecord *event, short *item);
  196. void            pstrcat(char *d, char *s);
  197. void            pstrcpy(char *d, char *s);
  198. void            OffsetControl(ControlHandle ctl, short dx, short dy);
  199.  
  200.  
  201. /************** Window.c **************/
  202.  
  203. OSErr            AppNewWindow(FileRecHndl frHndl, WindowPtr *retWindow);
  204. void            AppNewWindowTitle(WindowPtr window);
  205. Boolean            AppWindowDirty(WindowPtr window);
  206. Boolean            CloseAllWindows(void);
  207. Boolean            CloseOneWindow(WindowPtr window, short saveMode);
  208. WindowPtr        SetFilePort(FileRecHndl frHndl);
  209.  
  210.  
  211.